package br.ufpe.cin.rdfilter.model;

import java.math.BigDecimal;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Main2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		User u1 = new User();
		Term t = new Term();
		Query q = new Query();
		
		Feedback f = new Feedback();
		
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("RDFilter");
		EntityManager em = emf.createEntityManager();
		em.getTransaction().begin();
		u1 = em.find(User.class,1);
		q = em.find(Query.class,1);
		t = em.find(Term.class, 1);
		
		f.setQueryBean(q);
		f.setTerm("blrabla");
		f.setType("True Positive");
		f.setUserBean(u1);
		
		em.persist(f);
//		u2 = em.find(Usuario.class,2);

//		System.out.println(u2.getNome());
//		System.out.println(p2.getCategoria());
//		em.remove(p2);
//		em.merge(p2); 
		em.getTransaction().commit();
		em.close();
		emf.close();

	}

}
